import Vue from 'vue'
import Vuex from 'vuex'


Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    token:localStorage.getItem('token' || '[]'),
    routes: [],
    menuItems:localStorage.getItem('menuItems' || '[]') == null ? [] : JSON.parse(localStorage.getItem('menuItems' || '[]'))
  },
  mutations: {
    login(state, data){
      localStorage.setItem('token', data.token);
      localStorage.setItem('token', data.menuItems);
    }
  },
  actions: {
    connect(context){
    }
  }
});
